Implement a local registry type
authorAlex Crichton <alex@alexcrichton.com>
Fri, 5 Feb 2016 23:14:17 +0000 (15:14 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 1 Aug 2016 17:14:52 +0000 (10:14 -0700)
commitc3a9599044ea362334d9c978ddff0b1a806b7e96
tree6e790b4814aa63e683d540a79ba4bfdc0f60ec99
parentf1e26ed3238f933fda177f06e913a70d8929dd6d
Implement a local registry type

This flavor of registry is intended to behave very similarly to the standard
remote registry, except everything is contained locally on the filesystem
instead. There are a few components to this new flavor of registry:

1. The registry itself is rooted at a particular directory, owning all structure
   beneath it.
2. There is an `index` folder with the same structure as the crates.io index
   describing the local registry (e.g. contents, versions, checksums, etc).
3. Inside the root will also be a list of `.crate` files which correspond to
   those described in the index. All crates must be of the form
   `name-version.crate` and be the same `.crate` files from crates.io itself.

This support can currently be used via the previous implementation of source
overrides with the new type:

```toml
[source.crates-io]
replace-with = 'my-awesome-registry'

[source.my-awesome-registry]
local-registry = 'path/to/registry'
```

I will soon follow up with a tool which can be used to manage these local
registries externally.
src/cargo/core/source.rs
src/cargo/sources/config.rs
src/cargo/sources/registry/index.rs
src/cargo/sources/registry/local.rs [new file with mode: 0644]
src/cargo/sources/registry/mod.rs
src/cargo/sources/registry/remote.rs
tests/bad-config.rs
tests/cargotest/support/mod.rs
tests/cargotest/support/registry.rs
tests/local-registry.rs [new file with mode: 0644]
tests/registry.rs